<?php 
/* 
 * This file is part of TCDB. 
 * 
 * Copyright (C) 2000-2009 
 * Technology Consultant Corps 
 * Grinnell College 
 * Grinnell, IA, 50112 
 * tc@grinnell.edu 
 * 
 * TCDB is free software; you can redistribute it and/or modify 
 * it under the terms of the GNU General Public License as published by 
 * the Free Software Foundation; either version 3 of the License, or 
 * (at your option) any later version. 
 * 
 * TCDB is distributed in the hope that it will be useful, 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
 * GNU General Public License for more details. 
 * 
 * You should have received a copy of the GNU General Public License 
 * along with TCDB. If not, see <http://www.gnu.org/licenses/>. 
 * 
 
 ============================================================================= 
 
 * display_image.php -- Displays image for user with $_GET['id']
 * 
 * Author: C.M. Lubinski
 * Created: 2009-07-06 
 * Last edited: 2009-07-06 
 */ 
 
$page_title = "display_image.php"; 

require('init.php'); 
require('require_login.php'); 
require('scrape_photo.php');

// Retrieve the image
if (list($image, $mime) = retrieveImage($_GET['id'], $_GET['buffer'], $mysqli)) {
    header("Content-type: $mime");
    echo $image;
}
else {
    echo "Image Not Available";
}

?> 
